import React, { Component } from 'react';
import Header from './Header.js';
import { List, InputItem, Button, WingBlank } from 'antd-mobile';
class App extends Component {
  componentDidMount () {
    // console.log(this.props)
    
  }
  RegisterFnUI (value,password,hasError) {
    // console.log(this)
    this.props.RegisterFn(value,password,hasError);
  }
  render() {
    return (
      <div className="container">
        <Header test={this}/>
        <div className="box">
            <div>
            <List>
              <InputItem
                type="phone"
                placeholder="请输入手机号"
                error={this.props.hasError}
                onErrorClick={this.props.onErrorClick}
                onChange={this.props.onChange}
                value={this.props.value}
              >手机号码</InputItem>
              <InputItem
                type="password"
                placeholder="****"
                value={this.props.password}
                onChange={this.props.onChangePass}
              >密码 </InputItem>
            </List>
            <WingBlank className="regbtn">
              <Button size="small" ref="tip" style={{ marginRight: '4px' }} type="primary" inline onClick = {this.RegisterFnUI.bind(this,this.props.value, this.props.password, this.props.hasError)}>点击注册</Button>
            </WingBlank>
          </div>
        </div>
      </div>
    );
  }
}

export default App;